<LayoutEditFormBox :loading="load">

    <template slot="main">
        <el-form ref="editForm" :model="form" label-width="120px" label-position="left">
            <LayoutCell>
                <LayoutCellItem title="结算设置">
                    <el-form-item label="佣金计算方式" prop="commission_type" :rules="{ required: true, message: '请选择'}">
                        <el-radio-group v-model="form.commission_type">
                            <el-radio :label="0">商品折扣价</el-radio>
                            <el-radio :label="1">实际支付</el-radio>
                        </el-radio-group>
                        <div class="text">商品折后价：按商品参加优惠活动后金额计算，不包含积分抵扣和优惠券优惠金额。（不含运费）</div>
                        <div class="text">实际支付：按订单最后实际支付金额计算。（不含运费）</div>
                    </el-form-item>

                    <!-- <el-form-item label="扣除商品成本">
                        <el-radio-group v-model="form.deduct_cost">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                        <div class="text">开启后，佣金计算时将扣除商品成本价，商品未设置成本价时不扣除成本价</div>
                        <div class="text">注：开启扣除成本价时，请确保商城商品已全部设置成本价</div>
                    </el-form-item>

                    <el-form-item label="">
                        <el-checkbox-group v-model="form.commission_less_profit">
                            <el-checkbox :label="1">分佣总额不得超过商品利润</el-checkbox>
                        </el-checkbox-group>
                        <div class="text">注意：勾选后，每笔订单中的所有分销商所获佣金之和，不得超过订单商品的利润总额（利润总额=商品售价-成本价），</div>
                        <div class="text">分佣计算方式和现有逻辑相同，根据分销层级，逐级分佣，分完为止。</div>
                    </el-form-item>

                    <el-form-item label="最低提现额度">
                        <el-input style="width: 200px;" type="number" v-model="form.withdraw_limit"><template slot="append">元</template>
                        </el-input>
                    </el-form-item>

                    <el-form-item label="佣金提现手续费">
                        <el-input style="width: 200px;" type="number" v-model="form.withdraw_charge"><template slot="append">元</template>
                        </el-input>
                    </el-form-item>

                    <el-form-item label="免手续费区间">
                        <el-input style="width: 200px;" type="number" v-model="form.withdraw_begin"><template slot="append">元</template>
                        </el-input>
                        至
                        <el-input style="width: 200px;" type="number" v-model="form.withdraw_end"><template slot="append">元</template>
                        </el-input>
                    </el-form-item> -->
                    
                    <el-form-item label="结算天数" prop="settlement_days" :rules="{ required: true, message: '结算天数 不能为空'}">
                        <el-input style="width: 200px;" type="number" v-model="form.settlement_days"><template slot="append">天</template>
                        </el-input><span class="text">（订单确认收货后多少天能申请提现）</span>
                    </el-form-item>

                    
                </LayoutCellItem>

                <LayoutCellItem title="提现方式">
                    <el-form-item label="提现审核" prop="withdraw_check" :rules="{ required: true, message: '请选择'}">
                        <el-radio-group v-model="form.withdraw_check">
                            <el-radio :label="true">手动审核</el-radio>
                            <el-radio :label="false">自动审核</el-radio>
                        </el-radio-group>
                    </el-form-item>

                    <el-form-item label="分销商等级" v-if="form.withdraw_check == false" prop="commission_level" :rules="{ required: true, message: '请选择分销商等级'}">
                        <el-select placeholder="分销商等级" clearable v-model="form.commission_level">
                            <el-option v-for="item in levelList" :label="item.name" :value="item.id"></el-option>

                            <!-- <el-option label="默认等级" value="1"></el-option>
                            <el-option label="市级代理" value="2"></el-option>
                            <el-option label="二" value="3"></el-option> -->
                        </el-select>
                        <div class="text">该等级以上分销商提现时，自动审核通过</div>
                    </el-form-item>

                    <el-form-item label="提现金额" v-if="form.withdraw_check == false" prop="commission_check_money" :rules="{ required: true, message: '提现金额 不能为空'}">
                        <el-input style="width: 200px;" type="number" v-model="form.commission_check_money"><template slot="append">元</template>
                        </el-input>
                    </el-form-item>

                    <!-- <el-form-item label="自动打款">
                        <el-radio-group v-model="form.auto_remit">
                            <el-radio :label="1">启用</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                        <div class="text">提现审核通过将自动打款（支付宝和银行卡仍需要手动打款）</div>
                    </el-form-item>

                    <el-form-item label="提现方式">
                        <el-checkbox v-model="form.withdraw_balance" :true-label="1" :false-label="0">提现到商城余额</el-checkbox>
                        <el-checkbox v-model="form.withdraw_wechat" :true-label="1" :false-label="0">提现到微信钱包</el-checkbox>
                        <el-checkbox v-model="form.manual" :true-label="1" :false-label="0">手动提现</el-checkbox>
                        <div class="text">选择支付宝或银行卡提现时，需要商户手动打款</div>
                    </el-form-item>

                    <el-form-item label="手动提现方式">
                        <el-checkbox v-model="form.withdraw_alipay" :true-label="1" :false-label="0">提现到支付宝</el-checkbox>
                        <el-checkbox v-model="form.withdraw_bank" :true-label="1" :false-label="0">提现到银行卡</el-checkbox>
                        <div class="text">选择支付宝或银行卡提现时，需要商户手动打款</div>
                    </el-form-item>

                    <el-form-item label="支持银行卡">
                        <div v-for="(item, index) in form.bank" class="input-inline">
                            <el-input style="width: 300px;" v-model="form.bank[index]"></el-input><span class="del-text" @click="del(item, index)">删除</span>
                        </div>
                    <div class="add-text" @click="add()">+添加</div>
                </el-form-item> -->
                </LayoutCellItem>
            </LayoutCell>
        </el-form>
    </template>
    <template slot="footer">
        <el-button type="primary" @click="sum()">确定</el-button>
    </template>

</LayoutEditFormBox>